#coding:utf-8
import time
from spider.WechatSpider import WechatSpider
from analysis.dbItems import dbWeixin
from run.run import run

class runWeixin(run):
    def run(self):
        weixin = WechatSpider(self.bloom,self.name)
        d = dbWeixin()
        rows = d.getKeywords()
        for row in rows:
            print(row[0])
            weixin.start(row[0].encode("utf8"),self.page)
            d.updateKeyword(row[0])
        self.bloom.saveData()
        d.makeResult()
if __name__=="__main__":
    a = runWeixin("weixin")
    a.start()